package com.bp.api.system;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.common.enums.SystemStatusEnum;

/**
 * 举报
 */
@RestController
@RequestMapping(value = "/api/report/", method = RequestMethod.POST)
public class ReportController {
	private static Logger logger = LoggerFactory.getLogger(ReportController.class);
	
	/**
	 * 提交举报
	 */
	@CrossOrigin
	@RequestMapping("/submit")
	public String submit(HttpServletRequest request) {
		JSONObject json = new JSONObject();
		try {
//			BpAboutUs about = new BpAboutUs();
//			about.setStatus(CommonCode.DATA_IS_VALID.getValue());
//			about.setSymbol(CommonCode.SYMBOL_IS_VALID.getValue());
//			List<BpAboutUs> dataList = aboutService.findBySearch(about);
//			
//			json.put("data", dataList);
			json.put("code", SystemStatusEnum.SUCCESS.getValue());
			json.put("message", "举报" + SystemStatusEnum.SUCCESS.getName() + "，感谢您的监督！");
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			json.put("code", SystemStatusEnum.SERVERERROR.getValue());
			json.put("message", SystemStatusEnum.SERVERERROR.getName());
		}
		return json.toString();
	}

}
